#include <iostream>
#include "ShootedEgg.h"

using namespace std;

int ShootedEgg :: count = 0;
ShootedEgg* ShootedEgg :: shootedEgg[EGG_LIMIT];

ShootedEgg :: ShootedEgg()
{
	if(count >= EGG_LIMIT)
	{
		cerr << "[Error]: the EGG_LIMIT of shootedEgg is too small!" << endl;
		exit(1);
	}

	shootedEgg[count++] = this;
};

ShootedEgg :: ~ShootedEgg()
{
	for(int i = 0; i < count; i++)
	{
		if(shootedEgg[i] == this)
			shootedEgg[i] = shootedEgg[--count];
	}
}